From what I understand too, it can be beneficial during pregnancy if there aren't any preterm labor issues.
Normally, the oxytocin release causes your uterus to contract. If there's no worries about accidentally triggering preterm labor then it works to tone your uterine muscles. Even breast stimulation can release a powerful dose. After you give birth you still have to push out the placenta. From my experience, the first thing they do, even before cutting the cord, is try to get the baby nursing right away because that stimulation causes the uterus to contract on its own, push out the placenta, and shrink back down to normal size (which stops the bleeding).
Later on in pregnancy it can be good. For stimulating labor like someone mentioned. There are also hormones in semen that help prime the cervix for delivery.
Preterm labor sucks, and I'm really glad they were able to stop yours. Chug water like there's no tomorrow. Staying well hydrated will go a long way to you carrying until full term. Rest if you start contracting. That sort of thing.
ETA: The nursing thing works really well for whelping a litter of puppies if the dam is going uncomfortably long between pushing them out. It's pretty common to keep puppies nursing through the delivery to help keep contractions coming regularly and puppies coming out in a timely fashion.