Global well-posedness for the 3D viscous nonhomogeneous incompressible magnetohydrodynamic equations