Uncertainty quantification and posterior sampling for network reconstruction