Anharmonicity of a superconducting qubit with a few-mode Josephson junction