Synthesis of photocatalytic TiO2 nanoparticles: optimization of the preparation conditions