Geometric phase for N-level systems through unitary integration