Non-algebraic holomorphic maps between algebraic curves

The title and the body of the question seem to ask two different things. Let me give an answer to the second one. Since you are not asking that the compactification of $U$ is smooth, we can build up an example as follows.

Let $\bar{U}$ be a curve with one cusp $p$ such that its normalization is a projective genus $2$ curve $V$, and let $\nu \colon V \to \bar{U}$ be the normalization map. If $U=\bar{U} - \{p\}$ is the smooth locus of $\bar{U}$ and $q=\nu^{-1}(p)$, the restriction $\nu \colon V-\{q\} \to U$ is an isomorphism, and so is $\nu^{-1} \colon U \to V-\{q\}$.

Composing with the inclusion $V-\{q\} \to V$, we get a smooth algebraic map $U \to V$, whose image is $V - \{q\}$. This cannot be extended to a holomorphic map $\bar{U} \to V$, since $\bar{U}$ and $V$ are not biholomorphic.


Just turning my comments into an answer:

Following the OP, let $V$ be a smooth projective connected curve with negative Euler characteristic (i.e., genus at least two) over $\mathbb{C}$. Then $V$ is hyperbolic in the sense that Kobayashi's pseudometric is a metric. In particular, by a theorem of Kwack, it is "Borel hyperbolic", i.e., for every reduced finite type scheme $S$ over $\mathbb{C}$, every holomorphic map $S^{an}\to V^{an}$ is algebraic.

This implies that the answer to the OP's question is no. Indeed, let $\varphi:U^{an}\to V^{an}$ be a non-constant holomorphic map with $U$ a smooth curve. Then there is a morphism of varieties $f:U\to V$ such that $f^{an} = \varphi$. Such a morphism extends to a morphism $\overline{U}\to V$ by the valuative criterion for properness.