Positive semidefinite matrices with a given sparsity pattern