The trick is how the Joukowski map maps the region. It's more obvious if you write $z$ in polar form. Then the map becomes:
$$f(re^{j\varphi}) = {1\over2}\left(\left(r+{1\over r}\right)\cos\varphi,\left(r-{1\over r}\right)\sin\varphi\right)$$
Especially we see how the unit circle maps to the real $]-1,1[$ and the real line maps to the rest of the real line. We also see that the region $D$ maps into the upper half plane. So if we consider a mapping $\psi$ that on the real line is $1$ strictly inside the unit circle and $0$ strictly outside it.
To construct such a function one could consider $z^2-1$, which on the real line is positive where $\psi=1$ and negative where $\psi=0$ as described above. That is $\psi=\log(z^2-1)/\pi$ is a function whose imaginary part that fulfils the requirements (as the region of interrest is in the upper half plane one can select such a branch of $\log$).
Then we have a analytic function whose imaginary part fulfils the requirements for $\phi$, but the imaginary part of an analytic function is harmonic.