Riyad as-Salihin 120: On the Variety of Ways of Goodness
Abu Dharr relates that some people said to the Holy Prophet: The wealthy walk away with a great deal of merit. They pray as we pray and fast as we fast, but then they are able to give away in charity of their spare wealth. He said: Has not Allah endowed you with that which you can employ for charity? All glorification of Allah is charity, all praise of Allah is charity, all affirmation of Allah’s Unity is charity, all affirmation of Allah’s Greatness is charity, enjoining good is charity, forbidding evil is charity, consorting with your wives. is charity. They asked: Messenger of Allah (saw), is it that one of us should satisfy his urge and he would be rewarded? He said: If he satisfied his urge unlawfully would it not be sinful? Thus when he satisfies it lawfully it is meritorious (Muslim).