Gravitational Collapse of Magnetized Clouds. I. Ideal Magnetohydrodynamic Accretion Flow