Please compute through an example before asking! What happens if $U = \text{Spec}(k[x])$ and $Z = V(x)$?