Magnetic properties of carbon nanoparticles