Maximum a posteriori estimation of quantum states