Youthful west African country with dysfunctional economy presents vast challenges for winner of closely-run vote