Make a backup of all your important data before attempting this.
You need to boot from your installation media and use the Gparted application to shrink the filesystem, it is generally recommended to have a swap partition double the size of your RAM. Once you have shrunk the filesystem you should right-click on the now "unallocated space" and format it as swap. Once done, hit the "Apply all operations" button and reboot.
Now you should be back in your main Ubuntu system.
You need to run the gksudo gedit /etc/fstab
command and add a line like this:
/dev/sdXY swap swap defaults 0 0
Of course, change the XY to the correct settings for the system.
Finally, reboot or run sudo swapon /dev/sdXY
to use the swap without rebooting.