If the numbers are actually in the phone memory then unless you can get the phone repaired then they are lost.
Sometimes the phone can have the circuit board dried and cleaned and will work again - it depends on whether there is any corrosion, the longer it is left the worse it will be. If plain water it might be OK, but probably not if salt water.
If you are OK with taking it apart then dry it off with kithen roll then use a brush and isopropyl alcohol (could use tape head cleaner liquid, possibly meths but it could damage the plastics, but NOT white sprit or WD40) to clean the circuit board.
Otherwise take it to a phone repair centre where they can clean it in an ultrasonic bath.