"The Prophet was asked about whether a person who is sexually impure can sleep, or eat, or drink. He said: 'yes, if he does ablution as for the prayer.'"
Sunan Ibn Majah Book 1, Hadith 326