Note: Turns out there is a much easier way to do this as there is an Ubercart function that does essentially the same thing (thanks to the comment below that pointed this out). Just use:
uc_product_is_product($node);
I left the original post below (although it is no longer really needed).