We present a study of the relative orientation between the magnetic field projected onto the plane of sky (B ⊥ ) on scales down to 0.4 pc, inferred from the polarized thermal emission of Galactic dust observed by Planck at 353 GHz, and the distribution of gas column density (N H ) structures on scales down to 0.026 pc, derived from the observations by Herschel in submillimeter wavelengths, toward ten nearby (d < 450 pc) molecular clouds. Using the histogram of relative orientation technique in combination with tools from circular statistics, we found that the mean relative orientation between N H and B ⊥ toward these regions increases progressively from 0 • , where the N H structures lie mostly parallel to B ⊥ , with increasing N H , in many cases reaching 90 • , where the N H structures lie mostly perpendicular to B ⊥ . We also compared the relative orientation between N H and B ⊥ and the distribution of N H , which is characterized by the slope of the tail of the N H probability density functions (PDFs). We found that the slopes of the N H PDF tail are steepest in regions where N H and B ⊥ are close to perpendicular. This coupling between the N H distribution and the magnetic field suggests that the magnetic fields play a significant role in structuring the interstellar medium in and around molecular clouds. However, we found no evident correlation between the star formation rates, estimated from the counts of young stellar objects, and the relative orientation between N H and B ⊥ in these regions.