US President Barack Obama has signed into law an initiative aimed at bringing electricity to 50 million people in sub-Saharan Africa by 2020.