I don't know that the OP can stop two teenagers from having sex, if they really decide that they want to, to be honest. I think that the best thing that this 13 year old girl's parents can do is try to make sure that she's not being pressurised into it by the boy (how old is he? Has the OP said? Because some senior schools have mixed year forms now... he could well be 15/16), that she has the self-respect and the self-confidence to know that "no" means NO, and perhaps do their utmost to ensure that yes, the school are aware of the situation. Perhaps the pastoral care team at the school could have a chat with the boy's parents? Oh, and definitely sort out some form of contraception which she, and not the boy, is in full control of (the Pill or mini-Pill, perhaps?). Essentially, though, whilst yes; the OP's daughter is very much still a child... when they're that age, they think they know everything, and they desperately want to be seen to be "grown up". I think most of us have been there, done that (albeit hopefully without the sex at 13, though!).
A girl in my year at school, many moons ago, fell for a "bad boy". Her parents - who were friends of the family, because I'd been in this girl's class since we started school, even though she and I didn't get along at all - were tearing their hair out over the situation. The school didn't want to know, the police didn't want to know, and their daughter wouldn't listen to them trying to reason with her. She gave birth three weeks before her 15th birthday. Fifteen years later, at 29, she became a grandmother - and that little girl is about to start senior school herself this term. My former school peer is, from what I can gather, extremely concerned that she might be a great-grandmother by the time she's 45, because she understands, from her own experience, that if a teenager wants to have sex... then they will have sex, irrespective of what their parents, or their teachers think/say about the subject. The only thing that parents can do, is... well... parent. Make sure their teenagers don't feel pressurised by their peers into doing something that they might not want to, that they have knowledge about contraception, that they are confident enough to say "no" if they need to... and that they know, without a shadow of a doubt, that they can confide in their parents at all times, about everything, if they choose and/or want to. They might not. Double edged sword.
And yes, I agree with previous posters that to a 13 year old being sent away from their home, especially if it's been their primary home since birth, is going to make them feel very rejected. Especially if there is a golden step-sister in the mix, I'm afraid.
OP, you and your ex need to work together on this one, rather than fighting, I'm afraid, to parent the daughter you created/brought into this world together. She needs you - even though from the sound of it she is very much acting out for the attention which she seems to crave (why is that, I wonder?). Perhaps if you didn't allow your husband's daughter to get away with manipulating situations so that your own is "the bad child"... she might have more confidence. In both herself - and you, as her mother.
But no court is going to force a 13 year old who feels rejected and abandoned by her primary carer, to spend any amount of contact time with them. You need to prepare yourself for that, I'm afraid.