When smartphone freeze before standby mode it means it has software or booting problem . All you have to do is flash it with newer firmware then your problem will be solve. Only do if you are what are you doing because miss handling can lead to brick your device.
Your contacts are save in main board. If i were in your position i will contact to local technician to use my phone main board in other Iphone then recover all contacts and needed data. This is best solution i can gave you.