The geometric phase in nonlinear frequency conversion