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. We ask Allaah to exalt his mention as well as that of his family and all his companions.
Whoever prays while in a state of sexual defilement, his prayer is invalid and he has to make it up; please refer to Fatwa: 88716 on this regard.
As regards the people who prayed behind you, their prayer is valid according to the most preponderant opinion of the scholars and they do not have to make up their prayer if they did not know when you led them in prayer that you required a bath because of sexual defilement. This is what has been reported from 'Umar, 'Uthmaan and 'Ali . This is also the view of Imaam Maalik, Ahmad, Al-Hassan Al-Basri, Sa'eed Ibn Jubayr and others. Al-Bayhaqi reported that 'Uthmaan led the people in Fajr prayer, and when it was daylight, he looked to his clothes and noticed that he was in a state of sexual defilement. Then he said: "I swear by Allaah that I have reached the state of an advanced age, I find myself in a state of sexual defilement yet I did not realize it." He then made up his prayer but did not order the other companions to make it up.
Allaah knows best.