At least eight civilians have died and dozens have been injured after being caught in the crossfire between rebel and pro-government forces in Somalia.