Indeed, according to Dr. John Guillebaud in his book Contraception: Your Questions Answered, some of the lowest birth rates in history pop up around cultures whose primary method of contraception is the pull and pray method.
This method, also known as "Coitus Interruptus" or the "withdrawal method", was once one of the most popular methods of preventing pregnancy, but in recent times has been cast aside in many cultures. It turns out though, as long as you get the "pull" part right, there really isn't much praying necessary. According to research done in 2008 at the Guttmacher Institute in New York, the withdrawal method, when executed perfectly, is 96% effective for preventing pregnancy. For comparison, using a condom, when done perfectly, is 98% effective and oral contraception has a "perfect use" rate of 99.7% effective.
Now this is when all three methods are done "perfectly", so what about in actual practice with everyday people? The pull and pray method is roughly 82% effective while using a condom is roughly 83% effective, so you are only getting a 1% improvement for your money and effort. The pill, in contrast, does offer a much better "actual use" rate of about 96%.
So what gives? Why is withdrawal working just as well as condoms? It turns out that, according to recent studies, pre-ejaculate almost never contains any sperm. The few times sperm did show up in the studies, they tended to be immobile and clumped together, so basically dead or completely incapable of impregnating anything. This is because the only way sperm can get into the pre-ejaculate is if it was already in the urethra from a previous ejaculation, due to the fact that the Cowper's gland contains no sperm. Thus, as long as the man has either peed since the last time he ejaculated or it has simply been a while since that time, which probably means he's peed at some point anyways, the withdrawal method is extremely effective as a birth control method.
It's also arguably easier to execute this method "perfectly", achieving closer to the 96% effective rate, than it is with condoms, with the failure rate of condoms typically coming from the condom breaking. The primary cause of failure with the pull and pray method lies in the cases where the person executes the praying part perfectly, after the fact, but didn't manage the "pull" part of the method, which is of course the most important bit; though on failure of that, the praying probably doesn't hurt.
Bonus Facts:
Worldwide about 3% of couples rely on the withdrawal method as their primary means of contraception, though almost 52% of women report that they have used the withdrawal method at some point in their lives and among the surveyed 21% said they had used this withdrawal method in the last month.
Previous to the Roman Empire, evidence suggests that the withdrawal method was the primary form of contraception used. This fell out of popularity with the Romans who favored other methods available at the time, most of which have been lost to history. After the fall of the Roman Empire around the 400s, all methods of contraception fell out of practice in the western world due to Christianity who saw it as sinful. Around the 1800s, however, the withdrawal method saw a huge resurgence and was the primary form of contraception in the world until methods such as the condom and the pill were introduced in the 20th century.
The oldest documented use of the withdrawal method to avoid pregnancy was the story of Onan in the Torah, believed to have been written around 2500 years ago.