Next-to-leading-order Monte Carlo simulation of diphoton production in hadronic collisions