Role of intrinsic and extrinsic defects on the optical and electrical properties of zinc oxide films deposited by spray pyrolysis and dc sputtering