Synthesis of carbon-encapsulated nickel nanoparticles