Talking to your children about sex is the best way to avoid unwanted pregnancies, study says