Risk factors for antepartum and intrapartum stillbirth: a population-based study