Facile Synthesis of Multifunctional Nanocomposites with Tunable Luminescent and Magnetic Properties