Not my area of expertise but I believe the explanation is: the radiation profile is blackbody radiation proportional to the heat of the flame. The metal salts color the flame by absorbing light and re emitting it according to their electron transitions. However the don't add additional energy so there will be no UV light, since the original flame doesn't produce (almost any) photons that energetic. Magnesium burns much hotter and emits uv directly from blackbody profile.