A new study of the chemical structure of the Horsehead nebula: the influence of grain-surface chemistry