The statistical detection of clusters in networks