N = 4 supergravity coupled to N = 4 matter and hidden symmetries