Efficient integration over the unitary group with applications