Microscopic and macroscopic polarization within a combined quantum mechanics and molecular mechanics model