Facile synthesis of Cu2O and CuO nanoparticles and study of their structural, optical and electronic properties