Thanks to the way that the human penis is built, it's very sensitive to changes in cardiovascular health. In essence, the penis is a blood sponge inside a skin balloon, inflated by blood pressure. When an erection is triggered, the arteries delivering blood into the penis open up to improve the inbound flow rate, while the veins that drain blood contract to limit the outflow rate. More blood in, less blood out, tada it's a boner.
The only muscles involved there are those managing the diameter of the blood vessels, and those aren't muscles you can exercise. But that doesn't mean that exercise isn't something you can do to help your erection quality. In fact, exercise is one of the best things you can do to help your erection quality.
The benefits of exercise are manifold, and when it comes to penises it's great for both your stamina in bed and your erection quality. The latter point is driven entirely by your cardiovascular health, and almost any vigorous and sustained exercise will help to improve and maintain your cardio health. Those aerobic cardio exercises make the heart pump hard and keep pumping, and the heart is the single most important organ that contributes to erection quality.
For clarity's sake, being in better shape will not make your dick bigger; you're not growing any extra cells in this process. But better cardiovascular health will help you maximize your erection quality by achieving more of its actual potential. It's one of the things with the greatest impact on your penis.
So what exercises should you do? While weight exercises are great for building strength, there's little better for heart health than aerobic exercises. Long runs, walks, bike rides, ellipticals, rowing, etc — the more you do that, the stronger and healthier your heart will be. And the stronger your heart is, the stronger your erections will be.