The impact of heterogeneity in contact structure on the spread of infectious diseases