An extremal graph problem