Magnetic fields are proposed to have played a critical role in some of the most enigmatic processes of planetary formation by mediating the rapid accretion of disk material onto the central star and the formation of the first solids. However, there have been no experimental constraints on the intensity of these fields. Here we show that dusty olivine-bearing chondrules from the Semarkona meteorite were magnetized in a nebular field of 54 ± 21 μT. This intensity supports chondrule formation by nebular shocks or planetesimal collisions rather than by electric currents, the x-wind, or other mechanisms near the sun. This implies that background magnetic fields in the terrestrial planet-forming region were likely 5-54 μT, which is sufficient to account for measured rates of mass and angular momentum transport in protoplanetary disks.