Sunan an-Nasa'i, Book 22, Hadith 152 (Nasa'i 2246)

It was narrated that 'Abdullah said:

"The Messenger of Allah said: 'Whoever among you can afford to get married, let him do so, and whoever cannot afford it should fast, for it will be a restraint (Wija) for him."'