Place the following config in /etc/ufw/before.rules . Make sure to place it before the *filter section.
/etc/ufw/before.rules
*filter
*nat :PREROUTING ACCEPT [0:0] -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080 COMMIT