First MHD simulation of collapse and fragmentation of magnetized molecular cloud cores