Geometric invariant theory and nonabelian Hodge correspondence