The possible presence of amorphous and heterogeneous phases in the inner crust of a neutron star is expected to reduce the electrical conductivity of the crust, with potentially important consequences on the magneto-thermal evolution of the star. In cooling simulations, the disorder is quantified by an impurity parameter which is often taken as a free parameter. We aim to give a quantitative prediction of the impurity parameter as a function of the density in the crust,performing microscopic calculations including up-to-date microphysics of the crust. A multi-component approach is developed at finite temperature using a compressible liquid drop description of the ions with an improved energy functional based on recent microscopic nuclear models and optimized on extended Thomas-Fermi calculations. Thermodynamic consistency is ensured by adding a rearrangement term and deviations from the linear mixing rule are included in the liquid phase. The impurity parameter is consistently calculated at the crystallization temperature as determined in the one-component plasma approximation for the different functionals. Our calculations show that at the crystallization temperature the composition of the inner crust is dominated by nuclei with charge number around $Z \approx 40$, while the range of the $Z$ distribution varies from about 20 near the neutron drip to about 40 closer to the crust-core transition. This reflects on the behavior of the impurity parameter that monotonically increases with density up to around 40 in the deeper regions of the inner crust. Our study shows that the contribution of impurities is non-negligible, thus potentially having an impact on the transport properties in the neutron-star crust. The obtained values of the impurity parameter represent a lower limit; larger values are expected in the presence of non-spherical geometries and/or fast cooling dynamics.