No. Mormons do not believe any such thing. This is a myth perpetuated by anti-Mormons in order to make the Mormon church look like a bunch of crazy lunatics. We believe that Mary was a virgin before and after she gave birth to Jesus as stated in the Book of Mormon in 1 Nephi 11:18-20:
And he said unto me: Behold, the virgin whom thou seest is the mother of the Son of God, after the manner of the flesh. And it came to pass that I beheld that she was carried away in the Spirit; and after she had been carried away in the Spirit for the space of a time the angel spake unto me, saying: Look! And I looked and beheld the virgin again, bearing a child in her arms.
What Mormons do believe is that Christ is literally the Son of God, but there is no official statement nor any common belief as to the means by which the conception of Christ was effected, although the above statement would seem to make it clear that God did not have sex with Mary seeing as how she is referred to as still being a virgin even after the birth of Christ.
So why do people say that Mormons believe that God had sex with Mary? By taking statements by LDS Church members out of context, as usual. None of these statements say that God had sex with Mary nor did those from whom the quotes are taken intend to communicate such a concept. The full intent of their statements is to declare that Jesus is literally the Son of God. None of them make statements as to how Mary got to be pregnant, other than that it was of God and not of man. What they do affirm is that God is literally the father of Jesus Christ. That Christ had a mortal mother and an immortal father. That Christ is God incarnate, or the offspring of God in the flesh.