The act of abortion has existed since 1000 BCE with the earliest being 1550 BCE. Around the estimated time of the mythical Moses. Obviously not as effective, but the practice existed. Not to mention sex isn't one specific act. There are many ways to have sex, even by biblical standards, that do not involve the possibility of getting pregnant.