Blazars are potential candidates of cosmic-ray acceleration up to ultrahigh energies (E 10 18 eV). For an efficient cosmic-ray injection from blazars, pγ collisions with the extragalactic background light (EBL) and cosmic microwave background (CMB) can produce neutrino spectrum peaks near PeV and EeV energies, respectively. We analyze the contribution of these neutrinos to the diffuse background measured by the IceCube neutrino observatory. The fraction of neutrino luminosity originating from individual redshift ranges is calculated using the distribution of BL Lacs and FSRQs provided in the Fermi -LAT 4LAC catalog. Furthermore, we use a luminosity dependent density evolution to find the neutrino flux from unresolved blazars. The results obtained in our model indicate that as much as ≈ 10% of the flux upper bound at a few PeV energies can arise from cosmic-ray interactions on EBL. The same interactions will also produce secondary electrons and photons, initiating electromagnetic cascades. The resultant photon spectrum is limited by the isotropic diffuse γ-ray flux measured between 100 MeV and 820 GeV. The latter, together with the observed cosmic-ray flux at E > 10 16.5 eV, can constrain the baryonic loading factor depending on the maximum cosmic-ray acceleration energy.