You have that the normal subgroups $U, V$ generated by $g$ and by $h$ are Abelian. This only implies that $UV$ is normal and solvable of class 2. Take the group of unitraangular 3 by 3 matrices $H_3$ over ${\mathbb Z}_p$.
It has two normal Abelian subgroups $U,V$ containing the center (= the derived subgroup) generated by the elementary matrix $E_{1,3}(1)$: $U$ generated as a subgroup by the center and $E_{1,2}(1)$, $V$ is generated by the center and $E_{2,3}(1)$. Both subgroups are normal because they contain the derived subgroup. The product of these two subgroups is the whole $H_3$ (hence non-abelian). So you can take $g=E_{1,2}(1), h=E_{2,3}(1)$.