Time-dependent chemistry in dense molecular clouds. II - Ultraviolet photoprocessing and infrared spectroscopy of grain mantles