Investigation of optical and electrical properties of erbium-doped TiO2 thin films for photodetector applications