Effects of differential rotation on the gravitational figures of Jupiter and Saturn