Context. With an absorption column density on the order of 1024 cm−2, IGR J16318−4848 is one of the most extreme cases of a highly obscured high mass X-ray binary. In addition to the overall continuum absorption, the source spectrum exhibits a strong iron and nickel fluorescence line complex at 6.4 keV. Previous empirical modeling of these features and comparison with radiative transfer simulations raised questions about the structure and covering fraction of the absorber and the profile of the fluorescence lines. Aims. We aim at a self-consistent description of the continuum absorption, the absorption edges, and the fluorescence lines to constrain the properties of the absorbing material, such as ionization structure and geometry. We further investigate the effects of dust absorption on the observed spectra and the possibility of fluorescence emission from dust grains. Methods. We used XMM-Newton and NuSTAR spectra to first empirically constrain the incident continuum and fluorescence lines. Next we used XSTAR to construct a customized photoionization model where we vary the ionization parameter, column density, and covering fraction. In the third step we modeled the absorption and fluorescence in a dusty olivine absorber and employed both a simple analytical model for the fluorescence line emission and a Monte Carlo simulation of radiative transfer that generates line fluxes, which are very close to the observational data. Results. Our empirical spectral modeling is in agreement with previous works. Our second model, the single gas absorber does not describe the observational data. In particular, irrespective of the ionization state or column density of the absorber, a much higher covering fraction than previously estimated is needed to produce the strong fluorescence lines and the large continuum absorption. A dusty, spherical absorber (modeled as consisting of olivine dust, although the nature of dust cannot be constrained) is able to produce the observed continuum absorption and edges. Conclusions. A dense, dusty absorber in the direct vicinity of the source consisting of dust offers a consistent description of both the strong continuum absorption and the strong emission features in the X-ray spectrum of IGR J16318−4848. In particular, for low optical depth of individual grains, which is the case for typical volume densities and grain size distribution models, the dust will contribute significantly to the fluorescence emission.