Modeling the electrical conductivity in BaTiO3 on the basis of first-principles calculations