Context. The magnetic field configurations in several nearby spiral galaxies contain magnetic arms that are sometimes located between the material arms. The nearby barred galaxy M83 provides an outstanding example of a spiral pattern seen in tracers of gas and magnetic field. Aims. We analyse the spatial distribution of magnetic fields in M83 and their relation to the material spiral arms. Methods. Isotropic and anisotropic wavelet transforms are used to decompose the images of M83 in various tracers to quantify structures in a range of scales from 0.2 to 10 kpc. We used radio polarization observations at λ6.2 cm and λ13 cm obtained with the VLA, Effelsberg and ATCA telescopes and APEX sub-mm observations at 870 μm, which are first published here, together with maps of the emission of warm dust, ionized gas, molecular gas, and atomic gas. Results. The spatial power spectra are similar for the tracers of dust, gas, and total magnetic field, while the spectra of the ordered magnetic field are significantly different. As a consequence, the wavelet cross-correlation between all material tracers and total magnetic field is high, while the structures of the ordered magnetic field are poorly correlated with those of other tracers. The magnetic field configuration in M83 contains pronounced magnetic arms. Some of them are displaced from the corresponding material arms, while others overlap with the material arms. The pitch angles of the magnetic and material spiral structures are generally similar. The magnetic field vectors at λ6.2 cm are aligned with the outer material arms, while significant deviations occur in the inner arms and, in particular, in the bar region, possibly due to non-axisymmetric gas flows. Outside the bar region, the typical pitch angles of the material and magnetic spiral arms are very close to each other at about 10• . The typical pitch angle of the magnetic field vectors is about 20• larger than that of the material spiral arms. Conclusions. One of the main magnetic arms in M83 is displaced from the gaseous arms similarly to the galaxy NGC 6946, while the other main arm overlaps a gaseous arm, similar to what is observed in M51. We propose that a regular spiral magnetic field generated by a mean-field dynamo is compressed in material arms and partly aligned with them. The interaction of galactic dynamo action with a transient spiral pattern is a promising mechanism for producing such complicated spiral patterns as in M83.