Pep Guardiola will stand down as Barcelona head coach at the end of the season and will be replaced by his assistant Tito Vilanova.