Extract all images out from each node in content type
Which book runs right before a node is published?



hook_node_update($node) The hook is invoked after the node is inserted/updated in the node table



  What's the best way of saving those URLs in the database?



It totally depends upon your needs, Simply you will have to save in database in your own table(s).



  Which Drupal function do I use to retrieve those URLs?



It is not clear from where you want to retrieve. Database or Node Body.

For database you need to focus on Database abstraction layer
For Node body, you will have to parse some way e.g. PHP Simple Dom Parser