Coulomb breakup effects on the optical potentials of weakly bound nuclei