The Rema in [Even Ha'Ezer 1:6](http://beta.hebrewbooks.org/tursa.aspx?a=eh_x7487) writes that one fulfills the mitzvah of p'ru u'revu with a child who is a mamzer, which by definition is out of wedlock:

>היה הבן ממזר... קים המצוה

>If the child is a _mamzer_, he fulfills the mitzvah.