You can use Azure Startup task for this. Here are the steps you can follow:
Build a powershell script which will install Splunk Universal Forwarder (reference - http://docs.splunk.com/Documentation/Splunk/6.0.3/Forwarding/DeployaWindowsdfviathecommandline)
Add a startup task to your web role. This startup task can be a batch file that will trigger the above powershell. (Reference - http://msdn.microsoft.com/en-us/library/hh180155.aspx)
Package and deploy the cloud service. Once the status of the Web role becomes Ready, you can RDP and verify the universal forwarder installation.