All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
It is permissible for you to recite whatever you wish of the Quran while in that condition as it is not a condition to be in a state of ablution or pure from impurities [on your body and clothes] to read the Quran. Also, it is permissible for you to stay in the mosque for a need even if you are stained with impurity if you are sure that you will not pollute the mosque with it.
Haashiyatu Ash-Shirwaani, a Shafi’i book of Fiqh, reads: “It is forbidden for someone to enter [i.e. the mosque] with an impurity on his clothes or shoes whether or not the impurity is wet if he fears to pollute the mosque, otherwise no. The same thing applies if his entering is without a need.”
For more benefit, please refer to Fataawa 87992, 82085and 163887.
Allaah Knows best.