Frequent masturbation generally does not reduce sperm count or quality, nor does it affect the ability to achieve an erection.
In fact, having no sexual climax (ejaculation) for a period of time may reduce the number of sperm with normal shape and motility, which can lower male fertility. This is because only sperm with normal shape and motility can successfully combine with an egg to form a fertilized embryo.
Therefore, if you want to increase your partner's chances of getting pregnant, it is best to have sex a few times a week. Whether or not you masturbate typically does not affect your fertility.