No contradiction, when you understand the differences in sanctification in our langage and the language of the time when this passage was written for the Jew.
This cannot be understood of internal sanctification, which is never the case; an unbeliever cannot be sanctified by a believer in this sense, for such a sanctification is only by the Spirit of God;
Clearly he only means that the marriage relation is sanctified so that there is no need of a divorce. If either husband or wife is a believer and the other agrees to remain, the marriage is holy and need not be set aside. This is so simple that one wonders at the ability of men to get confused over Paul's language.
The very act of marriage, which, in the language of the Jews, is expressed by being "sanctified"; in this case when you continue in the scripture (instead of focusing on just one part) you find that this sanctification here is more in line with declaring that the children are legitimate under their law.
Else were your children unclean (epei ara ta tekna akaqarta). The common ellipse of the condition with epei: "since, accordingly, if it is otherwise, your children are illegitimate (akaqarta)." If the relations of the parents be holy, the child's birth must be holy also (not illegitimate). "He is not assuming that the child of a Christian parent would be baptized; that would spoil rather than help his argument, for it would imply that the child was not agioß till it was baptized. The verse throws no light on the question of infant baptism" (Robertson and Plummer).