Incorporation of density-matrix wave functions in Monte Carlo simulations: Application to the frustrated Heisenberg model