Dielectric spectroscopy in the frequency range 10(6)-10(9) Hz was applied to investigate the influence of hydrophilic and hydrophobic aerosil particles on molecular processes in the liquid crystal 4-n-pentyl-4'-cyanobiphenyl. The dynamics of the molecular process in the isotropic phase is non-Arrhenius; it weakly depends on the aerosil density and shows critical temperature dependence of the activation energy near the isotropic-nematic phase transition. The relaxation rate of the process related to the hindered rotation of the molecule around its molecular short axis (slower process) follows an Arrhenius law over about thirty degrees in the nematic range (except close to the phase transition) with an activation energy comparable to the bulk and is almost independent of the aerosil density. The relaxation rate of the process originating from the fluctuation of the molecular long axis around the director (librational mode, faster process), however, follows the Vogel-Fulcher-Tammann law. With increasing disorder achieved by increasing the aerosil density, the relative dielectric strength of the librational mode increases in comparison with the bulk. The relaxation frequency of the slower process increases but that of the faster process decreases with increasing aerosil density. Both these effects are less pronounced for hydrophobic than for hydrophilic aerosils.