  Measurements of the star formation activity on cloud scales are fundamental
to uncovering the physics of the molecular cloud, star formation, and stellar
feedback cycle in galaxies. Infrared (IR) emission from small dust grains and
polycyclic aromatic hydrocarbons (PAHs) are widely used to trace the obscured
component of star formation. However, the relation between these emission
features and dust attenuation is complicated by the combined effects of dust
heating from old stellar populations and an uncertain dust geometry with
respect to heating sources. We use images obtained with NIRCam and MIRI as part
of the PHANGS--JWST survey to calibrate dust emission at 21$\rm \mu m$, and the
emission in the PAH-tracing bands at 3.3, 7.7, 10, and 11.3$\rm \mu m$ as
tracers of obscured star formation. We analyse $\sim$ 20000 optically selected
HII regions across 19 nearby star-forming galaxies, and benchmark their IR
emission against dust attenuation measured from the Balmer decrement. We model
the extinction-corrected H$\alpha$ flux as the sum of the observed H$\alpha$
emission and a term proportional to the IR emission, with $a_{IR}$ as the
proportionality coefficient. A constant $a_{IR}$ leads to extinction-corrected
H$\alpha$ estimates which agree with those obtained with the Balmer decrement
with a scatter of $\sim$ 0.1 dex for all bands considered. Among these bands,
21$\rm \mu m$ emission is demonstrated to be the best tracer of dust
attenuation. The PAH-tracing bands underestimate the correction for bright HII
regions, since in these environments the ratio of PAH-tracing bands to 21$\rm
\mu m$ decreases, signalling destruction of the PAH molecules. For fainter HII
regions all bands suffer from an increasing contamination from the diffuse
infrared background.
