Inhomogeneities on various length scales suggesting phase separation seem to be a generic feature of hole-doped high-temperature superconducting cuprates. Also firmly established is the d-wave symmetry of the superconducting state. The interplay of superconductivity and phase separation has been noted in previous mean-field studies of correlated electron models. To further explore this issue in a more rigorous approach we have conducted quantum Monte Carlo calculations of a two-dimensional Hubbard model with nearest-neighbor attractive interaction. For a vanishing on-site repulsion, the result agrees with that of Micnas, Ranninger, and Robaszkiewicz [Phys. Rev. B 39, 11 653 (1989)], and indicates that for a given strength of the attractive interaction, homogeneous d-wave superconducting phase can exist only above a critical doping concentration, below which phase separation occurs. A finite on-site repulsion modifies the phase separation behavior. A stronger d-wave pairing correlation is seen in the inhomogeneous phase compared to the homogeneous phase.