Photodesorption of ices I: CO, N₂, and CO₂