Clusters of galaxies can potentially produce cosmic rays (CRs) up to very-high energies via large-scale shocks and turbulent acceleration. Due to their unique magnetic-field configuration, CRs with energy ≤1017 eV can be trapped within these structures over cosmological time scales, and generate secondary particles, including neutrinos and gamma rays, through interactions with the background gas and photons. In this work we compute the contribution from clusters of galaxies to the diffuse neutrino background. We employ three-dimensional cosmological magnetohydrodynamical simulations of structure formation to model the turbulent intergalactic medium. We use the distribution of clusters within this cosmological volume to extract the properties of this population, including mass, magnetic field, temperature, and density. We propagate CRs in this environment using multi-dimensional Monte Carlo simulations across different redshifts (from z ∼ 5 to z = 0), considering all relevant photohadronic, photonuclear, and hadronuclear interaction processes. We find that, for CRs injected with a spectral index α = 1.5 − 2.7 and cutoff energy Emax = 1016 − 5 × 1017 eV, clusters contribute to a sizeable fraction to the diffuse flux observed by the IceCube Neutrino Observatory, but most of the contribution comes from clusters with M ≳ 1014 M⊙ and redshift z ≲ 0.3. If we include the cosmological evolution of the CR sources, this flux can be even higher.