The plague is not really a major theme, but is briefly mentioned in the final act. The plague becomes a serious issue for Friar Laurence because it thwarts his plans to inform Romeo of Juliet's faked death and arrange for him to meet her at the tomb and take her safely to Mantua.
The reference to the plague most likely refers to the Black Plague, or bubonic plague, which began in the early 14th century, the century in which Romeo and Juliet is set in. The bubonic plague was highly infectious and killed millions. Friar Laurence had written a letter to Romeo explaining events and had commissioned Friar John to carry it to Romeo in Mantua. However, Friar John did not want to travel to Mantua by himself and sought a fellow brother to accompany him. The problem was that this fellow friar had been "visiting the sick," and the local authorities suspected them both of being "in a house / Where the infectious pestilence did reign" (V.ii.7, 9-10). As a result, both Friar John and his fellow friar were quarantined inside the house until it was known for sure that neither of them were also carrying the disease. The severe consequence for Friar Laurence is that, because Friar John was under quarantine, Friar Laurence's letter was not delivered to Romeo. Therefore, it was never explained to Romeo that Juliet's death was faked, and Romeo was unable to notice for himself that she was not truly dead. As a result, Romeo commits suicide so he can die by his wife's side, and Juliet follows suit.
Therefore, the plague severely influences Friar Laurence's plans and results in the real deaths of both Romeo and Juliet.