Global convergence of phase retrieval by quadratic approach