Pep Guardiola says Man City struggles contributed to agreeing new two-year deal