The multipole Hamiltonian for molecules