Surface effects in ferroelectrics: Periodic slab computations for BaTiO3