Collapse of low-mass clouds in the presence of a UV radiation field