There are several explanations for how Planck used quantization to explain blackbody radiation correctly without the ultraviolet catastrophe. I will follow this explanation.
For a cavity, the mode density per volume is $8\pi\nu^2/c^3$. Classically, the probability of occupation is equal for all modes and each mode has an energy $kT$. Thus, one obtains the Rayleigh-Jeans formula for blackbody radiation
$$I = \frac{8\pi\nu^2}{c^3}kT \, .$$
This blows up for large $\nu$. Planck's law instead says that the probability of occupation of a mode is $$\frac{1}{e^{h\nu/kT} - 1}$$ and the energy associated with that mode is $h\nu$. Therefore, we have $$I = \frac{8\pi\nu^2}{c^3}\frac{h\nu}{e^{h\nu/kT} - 1} \, .$$ This equation behaves correctly for large $\nu$. Where exactly did one need quantization?
For instance, I understand that the Boltzmann distribution (which works for continuous distributions) has probability of occupation that goes as $p(E) = e^{-E/kT}$. Let energy be proportional to frequency (but not quantized) and this also averts the ultraviolet catastrophe and qualitatively produces the same shape as Planck's law.
EDIT
Nope, the above statement is wrong. I realized that if you actually do the integration correctly, you get the law below which still blows up for large $\mu$ $$I = \frac{8\pi\nu^2}{c^3}kT \, .$$ END OF EDIT
So where does the requirement of quantization exactly come in?
This question is closely related to this one and this one but is not a duplicate since those questions were asked at a more basic level.