Geometric phase for an adiabatically evolving open quantum system