David Cameron has clashed with the president of Sri Lanka as he pushed for action to protect the rights of its minority Tamil community after a dramatic visit to the civil war-scarred north of the island.