Bayesian community detection for networks with covariates