Teleparallel gravity as a gauge theory: coupling to matter with Cartan connection