Disk formation during collapse of magnetized protostellar cores