If we separate quality into the three aspects of software quality: Functional, Process and Structural. I think the Agile methodology has a clear impact on all three. I will try to explain by quoting some relevant Agile princibles.
At regular intervals, the team reflects on how to become more
effective, then tunes and adjusts its behaviour accordingly.
Most Agile frameworks like Scrum use retrospectives to continuously improve process quality.
Deliver working software frequently, from a couple of weeks to a
couple of months, with a preference to the shorter timescale.
Getting continuous feedback should result in better functional quality as users explain what works, what doesn't and what works unexpected. As you deliver working software frequently you can measure the functional quality better and adapt faster, compared to a slow release-cycle like once a year.
Continuous attention to technical excellence and good design enhances
Most Agile frameworks (except Scrum) advocate clear technical practises. Practises like TDD, pair programming, continuous delivery, clean code and others all lead to higher structural quality.
The eXtreme Programming Agile framework has some good starting rules when it comes to coding that are advisable to improve not only your agility, but also your overal product quality.
This just scratches the surface of what I think what Agile brings to table to improve quality of a software product. Just keep in mind that Scrum lacks some key technical practises and that you should combine it with XP and or the LeSS practises. Without these practises you will most likely only improve your process quality.