Ultraviolet radiation in molecular clouds