Having sex while you're pregnant won't harm the baby because the penis can't penetrate beyond the vagina – the muscles of the cervix and a plug of mucus, specially formed in pregnancy, seal off the womb completely.
Later in pregnancy, an orgasm, or even sex itself, can set off contractions (known as Braxton Hicks contractions). You'll feel the muscles of your womb go hard. There's no need to panic because this is perfectly normal. If it feels uncomfortable, try your relaxation techniques or just lie quietly until the contractions pass.
It's really important that you protect yourself from STIs so check out the barrier methods that are available - barrier methods of contraception.