In this paper, we develop a lattice Boltzmann model for relativistic magnetohydrodynamics (MHD). Even though the model is derived for resistive MHD, it is shown that it is numerically robust even in the high conductivity (ideal MHD) limit. In order to validate the numerical method, test simulations are carried out for both ideal and resistive limits, namely the propagation of Alfvén waves in the ideal MHD and the evolution of current sheets in the resistive regime, where very good agreement is observed comparing to the analytical results. Additionally, two-dimensional magnetic reconnection driven by Kelvin-Helmholtz instability is studied and the effects of different parameters on the reconnection rate are investigated. It is shown that the density ratio has a negligible effect on the magnetic reconnection rate, while an increase in shear velocity decreases the reconnection rate. Additionally, it is found that the reconnection rate is proportional to σ-1/2, σ being the conductivity, which is in agreement with the scaling law of the Sweet-Parker model. Finally, the numerical model is used to study the magnetic reconnection in a stellar flare. Three-dimensional simulation suggests that the reconnection between the background and flux rope magnetic lines in a stellar flare can take place as a result of a shear velocity in the photosphere.