Why can UV light initiate a reaction between hydrogen and chlorine gas?
Before going into the mechanism of this reaction, I suggest you look up free radical mechanism, as this reaction takes place through that.

$\ce{Cl-Cl}$ bond in $\ce{Cl2}$ is weak enough to be broken by mere UV rays (present in sunlight), and hence they undergo homolytic cleavage (the resultant products are $\ce{Cl}$ atoms, not ions) to form two $\ce{Cl}$ free radicals. Now these $\ce{Cl}$ free radicals are extremely reactive (due to one free electron that it can share in a covalent bond) and hence attack hydrogen gas.

Now is the time you consider energy lowering. $\ce{H-Cl}$ bond is lot more stronger than $\ce{H2}$, and hence the formation of $\ce{H-Cl}$ bond formation will be favored instead of $\ce{H-H}$. Therefore, $\ce{Cl}$ free radical attacks $\ce{H2}$ gas to break the bond and form $\ce{HCl}$. The other $\ce{H}$ atom hence liberated forms a bond with the other $\ce{Cl}$ free radical.