Magnetic properties of polymer nanocomposites