Hydrogen production through renewable energy-powered electrolysis is pivotal for fostering a sustainable future hydrogen market. In the electricity sector, hydrogen production bears an additional demand that affects electricity price, and mathematical models are needed for the joint simulation, analysis, and planning of electricity and hydrogen sectors. This study develops a Cournot and a perfect competition model to analyze the links of the electricity and hydrogen sectors. In contrast to other solving methods approaches, the Cournot model is solved by convex reformulation techniques, substantially easing the resolution. The case studies, focusing on the Iberian Peninsula, demonstrate the region's potential for competitive hydrogen production, and the advantages of perfect competition to maximize the use of renewable energies, in contrast to Cournot's oligopoly, where the exercise of market power raises electricity prices. Sensitivity analyses highlight the importance of strategic decision-making in mitigating market inefficiencies, with valuable insights for stakeholders and policymakers.