In general, the curing of formaldehyde resins is acid catalyzed. You can use some photoacid generator (eg onium salt) producing acidic cure catalyst upon UV exposure. This method was employed in photoresist systems using phenolic novolac, melamine formaldehyde resin and photoacid generator. See eg: http://onlinelibrary.wiley.com/doi/10.1002/pen.760261605/abstract