You would need to let it dry out first. The amount of time it will take will vary. Depending on how wet the phone got, if it was submerged in the liquid, etc.
Your best bet, if it was really wet or submerged is to let it dry out for a week. Be sure it is opened, battery out, SIM out, SD card out, etc.
If it was not a lot of liquid, then just do this for 2+ days. Note, these are minimum time frames. However, longer is better. You want all liquid to be removed, and that will take time. You also need to leave it alone while it dries.
With any luck, you will at least be able to power it on so you can get the data you need. If after all that it doesn't work, then there is really not much you can do, unless you had a Google account that you synced the phones data to. Then your contacts may well be on that. Or if you had an SD card in the phone and set it to save the contacts to the card rather than the device. Then you can take the SD card out and try it in another device. Again, wait until that is dry though (the card).