An atomistic picture of the regeneration process in dye sensitized solar cells