The book was written by Hugo.
The book has been written by Hugo.
"I can't understand is the exact difference between the meaning of these two sentences. When is it better or more suitable to use the passive voice of past simple versus the passive voice of the present perfect?"
Contrary to erroneous claims above, the perfect tense does not mean that an action has been started in the past and may be 'on going' in the present; au contraire, the present "perfect" tense, as the name implies, dictates that the action is perfected, done, completed, fin. It is over.
English, the language of the angels, is the logical language. It is precise.
In the above examples, the former, is bad English, the latter, correct English:
'was written', is incomplete in that it fails to state when, and should thus have been stated more appropriately in the perfect tense;
"has been written", correctly draws attention to the fact that action is over, without needing to state when.
"I went to Japan last year.
I have been to Japan."
These are correct examples of the past and present perfect tenses respectively, the difference being, the former has context, the latter merely emphasizes completion of an action - again, perfected, ipso facto, done; learn to read Babylonian boobs, something less than 2% of the public does after the completion of formal indoctrinati.. er, I mean, education, as if any of today's blinkards really know what education means; check the etymology, chump - without deigning to dwell on context, merely fact.
Compare, a far more common usage:
"Students who are graduated..."
"Students who have graduated..."
The former, present simple passive voice, an erroneous usage, most often by Asian second language students who innately fail to grasp the perfect tense due to its conspicuous absence in their own native language, a fact reflected by the fact that less than 1% or only band 8.0 or above students in the IELTS exam can grok, the latter, correct usage of the perfect tense, indicating the completion of an action without needing to focus on the when, the context.
To answer the original question,
"When is it better or more suitable to use the passive voice of past simple versus the passive voice of the present perfect?"
It is more suitable to use the passive voice past simple when:
1) We wish to use the passive voice to draw attention to the object and not the subject of a sentence;
2) The use of the past tense dictates we provide a past context, ie, the when:
ie: Rose was raped by an asian last night.
Compare the obfuscation:
Rose has been raped.
No when, no who, no where, merely, perfected.