It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) said: "The child belongs to the owner of the bed (the husband), and for the fornicator there is deprivation."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11386