The molecules that researchers are using are called magnetic surfactants (surface-active agents), and they're able to coat the oil that's in a mixture of oil and water. The hydrophilic poles at the end of the surfactants stick out into the water and grab on. After that, the combination can be manipulated by magnets. Ideally, this means you could send a batch into an oil spill, let the oil, water, and emulsifier mix, then remove it all with a magnetic field.