Pep Guardiola has agreed to a new contract that will keep him at Manchester City until 2025.