Also we can assume that graph $G$ is connected. Let $s$ be the starting vertex, $n$ be the number of vertices and $m$ be the number of edges. At first it should be verified that function $\pi\colon V\setminus \{\,s\,\} \to V$ of parents in the tree really produces a tree, i. e. there is no sequence $v_1, \ldots, v_k$ of vertices that $v_1 = \pi(v_2)$, $\ldots$, $v_{k-1} \pi(v_k)$ and $v_k = \pi(v_1)$. It is tree if and only if each vertex can be attained from $s$ passing from parent $\pi(v)$ to vertex $v$ only. Use one DFS from $s$ to check attainability of all vertices, requires $\mathrm O(m)$ time.
Then you should check for each vertex $v$ that the for all neighour vertices $u$ inequality $d(s, u) \ge d(s, v) + w_{uv}$ holds ($d(a, b)$ is the distance between vertices $a$ and $b$ and $w_{ab}$ is the weight of edge $\{\,a, b\,\}$), i. e. for all vertices distance can not be reduced. It should be checked for each egde once, so requires $\mathrm O(m)$ time again.
There are two more conditions: distance from vertex $s$ to itself should be zero and distance to any other vertex $v$ should be equal to distance to it's parent $\pi(v)$ plus weight of edge, connecting them. Checking the first of these conditions requires $\mathrm O(1)$ time and checking the second one requires $\mathrm O(n)$ time.
All condition together:
$$\begin{cases}
\pi(\pi(\ldots\pi(v)\ldots)) = s & \forall v \in V(G) \,\\
d(s, u) \ge d(s, v) + w_{uv} & \forall u \in N_G(v),\\
d(s, s) = 0,\\
d(s, v) = d(s, \pi(v)) + w_{v\pi(v)} & \forall v \in V(G) \setminus \{\,s\,\}.
\end{cases}$$
Totally we need $\mathrm O(m)$ time for connected graph $G$. If need of any condition or sufficiency of their aggregate are not obvious, ask in comments.
Create a new graph, which consists of 3 "copies" of $G$. Each node $(a, n)$ of this new graph represents a situation "I've got to node $a$ of original graph and have visited nodes from $U$ exactly $n$ times". $n$ can be 0, 1 or 2.
Now you need to prepare edges. Edges would be directed and the rules are quite obvious: original edge between nodes $a$ and $b$ corresponds to several edges in a new graph: $(a, m) -> (b, m + x)$ where x is 1 if $b$ belongs to $U$ and 0 otherwise.
And now you only need to find a shortest way from $(s, 0)$ to $(t, 2)$.
Best Answer
Breadth first search is how I would expect to handle this.