You cannot install UltraVNC via RDP session. As you have discovered, and I discovered a few months back.
When restarted, the credentials just do not match, and because of that, the uvnc settings are saved on another place in a RDP session, and so they are not correctly reread on restart without the RDP session.
What I do in these cases is:
Open port 5900, so you can reach computer via VNC when it will be installed.
Make a batch script that will be run on computer startup, to automatically and silently install UltraVNC when the OS restarts. (Try it before restarting).
On restart, UltraVNC will be installed via the script, with the correct credentials, and will be reachable via port 5900. Connect and configure ultravnc as you like, out of the RDP session.
If you need to automatically logon an user when restart, to execute the script, use control userpasswords2 in a cmd window. Select the user and the password, and it will be automatically logged on when restarted.