We went out with God’s Messenger on the expedition to the B. al-Mustaliq (an expedition in 6 A.H) and took some Arab women captive, and we desired the women, for we were suffering from the absence of our wives. We liked withdrawing the penis and wanted to do so, but we asked ourselves whether we could do it when God’s Messenger was among us before asking him. So we asked him about that and he replied, “It does not matter if you do not do it, for every soul that is to be born up to the day of resurrection will be born.”
He told of a man who went to God's Messenger and said, “I have a slave-girl who is our servant and I have intercourse with her, but do not want her to conceive.” He replied, “Withdraw your penis from her if you wish, for what is decreed for her will come to her.” After a time the man came and told him the girl had become pregnant, and he said, “I told you that what was decreed for her would come to her.”
He said that when God’s Messenger was asked about withdrawing the penis he replied, “The child does not come from all the liquid, and when God intends to create anything nothing can prevent Him.”