Formation of Magnetized Prestellar Cores in Turbulent Giant Molecular Clouds