And then it hits me...it's the stuff they inject into you, eh?
Not exactly. The magnetic field interacts with the nuclei of the atoms of the materials which compose your body -- notably the nuclei of hydrogen atoms...
No, but you're thinking. The stuff they inject you with is actually injected to bring out contrast in the picture. There are plenty of MRI's done without using the contrast enhancer.
Here, with a tremendous number of oversimplifications is how MRI works: the nuclei of certain atoms have a small intrinsic spin. In the presence of a large magnetic field, nuclei in one spin state have a higher probably of aligning with the field than the other, so the spin tends to align with the magnetic field. Now, if you could put energy into those nuclei, some of them would get enough of a bump to "flip" over into the higher energy state, opposing the magnetic field. By applying an oscillating magnetic field (like that produced by alternating current) in addition to the large static field already applied, you can get the spins to flip in a predictable way. This release photons as the nuclei transition from one state to another, which can be read by a detector.
So MRI essentially amounts to reading the states of magnetic nuclei inside your body. The nuclei resonating with the magnetic fields in medical uses of MRI are certain hydrogen nuclei in water. Your body is mostly water. As I say, this is so oversimplified that some of it isn't quite right. But it's the basic idea.
Here's a very good, highly technical introduction: The Basics of NMR