Short answer: If you for some reason know that no eigenvalues of $H$ differ by a (non-zero) multiple of $2\pi$, then the condition on $U\in U(n)$ you are looking for is that it satisfies $\overline{U}U={\bf1}$;
here $\overline{U}$ denotes the entrywise complex conjugate of $U$.
Long answer: The key observation here is:
A Hermitian matrix $H$ has real eigenvectors if and only if $H$ is symmetric (i.e. $H=H^T$).
This is due to the fact that they can be diagonalized via an orthogonal matrix.
Then, defining $U:=\exp(-iH)$ one finds that:
If a Hermitian matrix $H$ is symmetric, then $\overline{U}U={\bf1}$ which is equivalent to $U^{-1}=\overline{U}$.
Proof.
As $H$ is Hermitian and symmetric we know $\overline{H}=(H^*)^T=H^T=H$. Therefore
$$
U^{-1}=\exp(iH)=\exp(i\overline{H})=\overline{\exp(-iH)}=\overline{U}\,.\tag*{$\square$}
$$
However, the converse need not hold and it's for the same reason that the matrix logarithm is not as straightforward.
For this consider the Hamiltonian
$$
H=\begin{pmatrix}
\pi&i\pi\\-i\pi&\pi
\end{pmatrix}
$$
which is obviously not symmetric, but because $H$ has eigenvalues $0$ and $2\pi$, $U=e^{-iH}$ has eigenvalues $1,e^{-2\pi i}=1,1$ so $U={\bf1}$. In other words we found a non-symmetric Hamiltonian for which $\overline{U}U={\bf1}$ (trivially).
Yet, distinct eigenvalues differing by multiples of $2\pi$ is the only problem that can occur:
Let $H$ be a Hermitian matrix such that for all eigenvalues $\lambda_1,\lambda_2$ of $H$ there exists no $n\in\mathbb Z\setminus\{0\}$ such that $\lambda_1=\lambda_2+2\pi n$.
Then $H$ is symmetric if and only if $\overline{U}U={\bf1}$ (equivalently: $U^{-1}=\overline{U}$).
Proof.
We already proved "$\Rightarrow$" above. For "$\Leftarrow$": $U^{-1}=\overline{U}$ as before implies $\exp(iH)=\exp(i\overline{H})$.
Now because $H$ is Hermitian we can diagonalize: $H=VDV^*$ with $V$ unitary and $D$ diagonal and real. This implies $\overline{H}=\overline{V^*}\overline{D}\overline{V}=V^TD\overline{V}$ and thus $e^{iH}=Ve^{iD}V^*=V^Te^{iD}\overline{V}=e^{i\overline{H}}$.
Rearranging things one arrives at $\overline{V}Ve^{iD}=e^{iD}\overline{V}V$, i.e. $[\overline{V}V,e^{iD}]=\overline{V}Ve^{iD}-e^{iD}\overline{V}V=0$ ("$\overline{V}V$ commutes with $e^{iD}$").
The "$2\pi$-condition" we imposed on $H$ now guarantees that $e^{iD}$ and $D$ have the same commutant as different eigenvalues of $H$ are mapped to different eigenvalues under $e^{i\bullet}$; in particular this lets us conclude that $e^{iD}$ and $D$ have the same commutant, that is, $[\overline{V}V,e^{iD}]=0$ is equivalent to $[\overline{V}V,D]=0$. [Note that this is precisely where our argument would break for the above example of $H$ as there, $e^{iD}={\bf1}$ commutes with everything, but $D$ doesn't].
But with this we are done:
$$
H^T=V^TD\overline{V}=V^TD\overline{V}VV^*=V^T\overline{V}VDV^*=\overline{VV^*}VDV^*=VDV^*=H\,.\tag*{$\square$}
$$