A minister has denied claims that Sir Keir Starmer could risk breaching international law with his pledge to recognise Palestine as a state.