UltraSn0w only supports the iPhone 3GS Old Bootrom on iOS 6.1.2 and 6.1.3. The new bootrom 3GS and 4 is only supported up to iOS 6.1. For the iPhone 4, the only way to unlock it via UltraSn0w is to have the 01.59.00 baseband, and you cannot downgrade basebands on the iPhone 4.
The only option of unlocking your device is to use an interposer such as the Gevey/R-SIM, or purchase an IMEI unlocking service assuming you know the original carrier of the device.