Praise be to Allah.
If a third party, other than the spouses, is introduced into the process of fertilization, such as eggs coming from another woman or another woman acting as a surrogate mother, or sperm coming from another man, then fertilization in such cases is haraam, because it is counted as zinaa (adultery). When a woman uses the sperm of a man, this comes under the same rulings as intercourse in terms of what is halaal and what is haraam.
With regard to the child who is born as the result of such a process, he is to be attributed to the mother who bore him, and not to the man who produced the sperm, as is the ruling in the case of zinaa (fornication or adultery). If that man claims to be the father and no one disputes that, then the child may be attributed to him, because the Lawgiver is keen that people should be named after their fathers. With regard to the hadeeth, “The child belongs to the (marriage-)bed and for the adulterer is the stone,” it is to be interpreted as referring to cases where there is a dispute, as is clear from the incident which gave rise to this hadeeth.