A method for reducing the reconstruction error and improving the spectral distribution in holographic data storage has been proposed. An optimized phase mask is introduced into the optical system. By using the phase mask, the reconstruction error and uniformity of the spectral distribution can be optimized. The relative importance between reconstruction error and uniformity can be emphasized with an adjustable weight factor. The phase mask can be designed by using amplitude-phase retrieval algorithms. Simulation results have shown the merits of the proposed method. The feasibility of optical realization is investigated briefly.